﻿

@using Pay.Model.Dto
@using Webdiyer.WebControls.Mvc
@using Pay.Model.Enums
@model PagedList<UserOutPut>





<table class="table table-hover">
    <thead>
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th>费率</th>
            <th>可用余额</th>
            <th>冻结金额</th>
            <th>角色名称</th>
            <th>创建时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            @{ int i = 0;}
            @foreach (var item in Model)
            {
                var temp = (item.FeeRate * 100).ToString("F2");


            <tr>
                @*<td>
                        <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='2'><i class="layui-icon">&#xe605;</i></div>
                    </td>*@
                <td>@(Model.StartItemIndex + i++)</td>
                <td>@item.UserName</td>
                <td>@temp %</td>
                <td>@item.TotalAmount.ToString("f2")</td>
                <td>@item.FreezeAmount.ToString("f2")</td>
                <td>@item.RoleName</td>
                <td>@item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")</td>
                <td class="td-status">
                    @if (item.IsEnable)
                    {
                        <span class="label label-success">已启用</span>

                    }
                    else
                    {
                        <span class="label label-danger">已停用</span>

                    }

                </td>
                <td class="td-manage">


                    <a title="删除" class="btn-xs btn-success" onclick="userDel(this,@item.Id)" href="javascript:;">
                        删除
                    </a>

                    @if (item.IsEnable)
                    {
                        <a title="停用" class="btn-xs btn-danger" onclick="member_stop(this,@item.Id)" href="javascript:;">
                            停用
                        </a>

                    }
                    else
                    {
                        <a title="启用" class="btn-xs btn-primary" onclick="member_stop(this,@item.Id)" href="javascript:;">
                            启用
                        </a>
                    }
                  
                    @if (ViewBag.IsShow)
                    {
                        <a title="修改费率" class="btn-xs btn-warning" onclick="updateFee(@item.MerchantId,'@item.UserName')" href="javascript:;">
                            修改费率
                        </a>
                        <a title="解冻" class="btn-xs btn-primary" onclick="unFreezeMoney(@item.MerchantId)" href="javascript:;">
                            解冻
                        </a>
                        <a title="冻结" class="btn-xs btn-danger" onclick="freezeMoney(@item.MerchantId)" href="javascript:;">
                            冻结
                        </a>
                    }
                  
                </td>
            </tr>
            }
        </tbody>
    </table>




    <div class="text-center">
        @*<div style="float:left;width:50%">当前 @Model.CurrentPageIndex 页，共 @Model.TotalPageCount 页, 共 @Model.TotalItemCount items 条</div>*@
        <span> 当前 @Model.CurrentPageIndex 页，共 @Model.TotalPageCount 页, 共 @Model.TotalItemCount  条</span>
        <nav>
            @Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ContainerTagName = "ul", CssClass = "pagination", CurrentPagerItemTemplate = "<li class=\"active\"><a  href=\"javascript:;\">{0}</a></li>", DisabledPagerItemTemplate = "<li class=\"disabled\"><a>{0}</a></li>", PagerItemTemplate = "<li>{0}</li>" }, new MvcAjaxOptions { UpdateTargetId = "articles", HttpMethod = "Post", DataFormId = "searchForm" })
        </nav>
    </div>


